<template>
  <view>
    <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="topbar">
      <text v-for="(item, index) in topbar" :key="index" :class="'item ' + (currentTab == index ? 'active' : '')"
            :data-idx="index" @tap="topbarFn">{{ item }}
      </text>
    </view>
    <swiper :circular="true" :current="currentTab" class="swiper" duration="200" @change="swiperChange">
      <swiper-item>
        <scroll-view
            :enableBackToTop="true"
            :enableFlex="true"
            :refresherEnabled="true"
            :refresherTriggered="triggered"
            :scrollTop="scrolltopNum_index"
            :scrollWithAnimation="true"
            :scrollY="true"
            class="ulist LIST_list"
            lowerThreshold="300"
            @refresherrefresh="upFn"
            @scroll="binnd_scroll_index"
            @scrolltolower="btmFn"
        >
          <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';'" class="sotab">
            <view :class="'li ' + pxclass" @tap="pxFn">
              <text class="span">排序</text>
              <text class="ico icon-jtbtm"></text>
            </view>
            <picker :range="pxSO.age.arr" :value="pxSO.age.def" class="li" headerText="请选择年龄" mode="multiSelector"
                    rangeKey="v" @change="px_ageFn">
              <text class="span">年龄</text>
              <text class="ico icon-jtbtm"></text>
            </picker>
            <picker :range="pxSO.heigh.arr" :value="pxSO.heigh.def" class="li" headerText="请选择身高"
                    mode="multiSelector"
                    rangeKey="v" @change="px_heighFn">
              <text class="span">身高</text>
              <text class="ico icon-jtbtm"></text>
            </picker>
            <view :class="'li ' + somoreclass" @tap="moreFn">
              <text class="span">更多</text>
              <text class="ico icon-jtbtm"></text>
            </view>
          </view>
          <view v-if="sobox" :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="soubox">
            <view :class="'a ' + (globalUtils.empty(sokind) || sokind == 'default' ? 'ed' : '')" data-sokind="default"
                  @tap="souboxFn">默认排序
            </view>
            <view :class="'a ' + (sokind == 'identity' ? 'ed' : '')" data-sokind="identity" @tap="souboxFn">实名认证
            </view>
            <view :class="'a ' + (sokind == 'photo' ? 'ed' : '')" data-sokind="photo" @tap="souboxFn">真人认证</view>
            <view :class="'a ' + (sokind == 'regtime' ? 'ed' : '')" data-sokind="regtime" @tap="souboxFn">最新加入
            </view>
            <view :class="'a ' + (sokind == 'endtime' ? 'ed' : '')" data-sokind="endtime" @tap="souboxFn">最近登录
            </view>
            <view :class="'a ' + (sokind == 'click' ? 'ed' : '')" data-sokind="click" @tap="souboxFn">人气最高</view>
          </view>
          <block v-for="(dl, index) in ARR_index" v-if="ARR_index.length > 0" :key="index">
            <view v-for="(rs, index1) in dl" :key="index1" :data-uid="rs.uid" class="dl" @tap="bind_dl">
              <image v-if="rs.rz_store.length > 0" :src="rs.rz_store" class="rz_store"></image>

              <view class="dt">
                <image :src="rs.photo_m" class="alpha0_100_1s" mode="aspectFill"></image>
                <image v-if="rs.grade > 1" class="vipj" mode="aspectFit" src="/static/res/img/vipj.png"></image>
              </view>

              <image v-if="rs.rzj.length > 0" :src="rs.rzj" class="rzj" mode="aspectFit"></image>

              <view class="dd">
                <view class="h4">
                  <text class="span">{{ rs.nickname }}</text>
                  <image :src="rs.grade_ico" class="ugrade1" mode="aspectFit"></image>
                </view>
                <text class="h6">{{ rs.datainfo }}</text>
                <text class="h5">
                  <text
                      v-for="(rs2, index2) in rs.hobby"
                      :key="index2"
                      :style="'color:' + color + ';background-color:rgba(' + rgbcolor + ',.05);border-color:rgba(' + rgbcolor + ',.1);'"
                      class="li"
                  >
                    {{ rs2 }}
                  </text>
                </text>
                <view v-if="rs.photolist.length > 0" class="pathlist">
                  <image v-for="(pl, index2) in rs.photolist" :key="index2" :class="rs.photolist_cls" :src="pl"
                         mode="aspectFill"></image>
                </view>
              </view>

              <text class="em">
                <text class="div">{{ rs.aboutus }}</text>
              </text>

              <view class="zoyq">
                <text :style="'background-color:' + color" class="li">寻觅</text>
                {{ rs.zoyq }}
              </view>
            </view>
          </block>
          <view v-if="ARR_index_nodata" class="nodata">
            <image mode="aspectFit" src="/static/res/img/nodata.png"></image>
            暂无符合条件的用户　
            <text :style="'color:' + color" data-sokind="default" @tap="souboxFn">返回首页</text>
          </view>
          <view v-if="loading_flag" class="loading">
            <image v-if="loading_ico_flag" class="loading_ico" src="/static/res/img/loading_ico.svg"></image>
            <text>{{ loading_str }}</text>
          </view>
        </scroll-view>
        <view v-if="backtop_flag_index" :style="'color:' + color" class="backtop fadeInUp" data-id="index"
              @tap="backtopFn">
          <text class="ico icon-backtop"></text>
          顶部
        </view>
        <navigator :style="'--color:' + color + ';'" class="btmKefuBtn" url="/pagesA/about/about">
          <view class="i ico"></view>
          客服
        </navigator>
        <view v-if="index_so_flag" :class="'mask1 div_right_mask ' + index_so_mask_class"
              @tap.stop.prevent="index_so_closeFn">
          <view :class="'div_right_box ' + index_so_box_class" @tap.stop.prevent="emptyFn">
            <view class="div_left_so">
              <form class="form_uid" @submit="index_SO_uid_submitFn">
                <input
                    :value="keyword"
                    autocomplete="off"
                    class="input"
                    confirmType="search"
                    maxlength="20"
                    name="keyword"
                    placeholder="按用户ID/昵称"
                    type="text"
                    @blur="index_SO_uid_bindblurFn"
                    @confirm="index_SO_uid_submitFn2"
                />
                <button class="ico" formType="submit" style="z-index: 9"></button>
                <input hidden name="sokind" type="text" value="keyword"/>
              </form>
              <form :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="form_ext" @submit="index_SO_submitFn"
                    @reset.stop.prevent="index_SO_resetFn">
                <block v-for="(item, index) in SO" :key="index">
                  <div v-if="item.fkind == 'range' || item.fkind == 'area'" class="listbox">
                    <picker
                        v-if="item.fkind == 'area'"
                        :data-f="item.f"
                        :data-idx="index"
                        :data-kind="item.kind"
                        :headerText="'请选择' + item.tbody"
                        :range="item.arr.def"
                        :value="item.arr.idx"
                        class="dl"
                        mode="multiSelector"
                        rangeKey="v"
                        @change="areaidFn"
                        @columnchange="areaidChangeFn"
                    >
                      <view class="dt">{{ item.tbody }}</view>
                      <view class="dd">
                        <view :class="'span' + (!globalUtils.empty(item.v) ? ' ed' : '')">{{ item.v }}</view>
                      </view>
                    </picker>
                    <picker
                        v-else
                        :data-f="item.f"
                        :data-index="index"
                        :headerText="'请选择' + item.tbody"
                        :range="item.arr.arr"
                        :value="item.arr.def"
                        class="dl"
                        mode="multiSelector"
                        rangeKey="v"
                        @change="rangFn"
                    >
                      <view class="dt">{{ item.tbody }}</view>
                      <view class="dd">
                        <view :class="'span' + (!globalUtils.empty(item.v) ? ' ed' : '')">{{ item.v }}</view>
                      </view>
                    </picker>
                  </div>

                  <block v-else>
                    <view v-if="item.f == 'child'" class="listbox" @tap="vipFn">
                      <view class="dl listdl_tips">
                        <view class="dt">以下仅对VIP会员开放</view>
                        <view class="dd">
                          <view class="btn2">
                            <text class="i ico"></text>
                            开通VIP
                          </view>
                        </view>
                      </view>
                    </view>
                    <view class="tbox">
                      <view :class="'h5 ' + item.onoff + (item.auth == 'vip' ? ' C999' : '')"
                            :data-index="index" @tap.stop.prevent="index_SO_onoffFn">
                        {{ item.tbody }}
                      </view>
                      <view :class="'ul def ' + (item.ulcls == 'col2' ? item.ulcls : 'col3')"
                            :style="'display:' + (item.onoff == 'on' ? 'block' : 'none')">
                        <view
                            v-for="(item2, idx2) in item.arr"
                            :key="idx2"
                            :class="'li' + (globalUtils.indexOf(item.i, item2.i) ? ' ed' : '')"
                            :data-auth="item.auth"
                            :data-fkind="item.fkind"
                            :data-i="item2.i"
                            :data-idx="index"
                            @tap.stop.prevent="index_SO_liFn"
                        >
                          {{ item2.v }}
                        </view>
                      </view>
                    </view>
                  </block>

                  <input :name="item.f" :value="item.i" hidden type="text"/>

                  <input :name="item.f + '_str'" :value="item.v" hidden type="text"/>
                </block>
                <input hidden name="sokind" type="text" value="ext"/>
                <view class="savebox">
                  <button class="reset" formType="reset">重置</button>
                  <button class="ico" formType="submit"> 确定</button>
                </view>
                <view class="blank"></view>
              </form>
            </view>
          </view>
        </view>
        <swiper v-if="marquee.length > 0 && marquee_flag" :autoplay="true" :circular="true" :vertical="true"
                class="iMarqueeBox"
                interval="2000">
          <swiper-item v-for="(item, index) in marquee" :key="index" class="li">
            <image :src="item.photo_s_url" mode="aspectFill"></image>

            <text class="font">{{ item.content }}</text>

            <text class="ico close" @tap="marqueeFn"></text>
          </swiper-item>
        </swiper>
      </swiper-item>
      <swiper-item>
        <scroll-view
            :enableBackToTop="true"
            :enableFlex="true"
            :refresherEnabled="true"
            :refresherTriggered="triggered2"
            :scrollTop="scrolltopNum_trend"
            :scrollWithAnimation="true"
            :scrollY="true"
            class="trend"
            lowerThreshold="300"
            @refresherrefresh="trend_topFn"
            @scroll="binnd_scroll_index"
            @scrolltolower="trend_btmFn"
        >
          <view class="tab2">
            <view class="a" data-t="new" @tap="trend_tab2Fn">
              <view class="i _new ico"></view>
              <text class="span">最新</text>
            </view>
            <view class="a" data-t="hot" @tap="trend_tab2Fn">
              <view class="i _hot ico"></view>
              <text class="span">热门</text>
            </view>
            <view class="a" @tap="trend_addFn">
              <view class="i _add ico"></view>
              <text class="span">发布</text>
            </view>
            <view class="a" data-t="my" @tap="trend_tab2Fn">
              <view class="i _my ico"></view>
              <text class="span">我的</text>
            </view>
            <view class="a" @tap="trend_soFn">
              <view class="i _so ico"></view>
              <text class="span">筛选</text>
            </view>
          </view>
          <block v-for="(dl2, trend_idx) in ARR_trend" v-if="ARR_trend.length > 0" :key="trend_idx">
            <view v-for="(item, trend_idx2) in dl2" :key="trend_idx2"
                  :style="'--color:' + color + ';--rgbcolor:' + rgbcolor"
                  class="dl">
              <view class="dt">
                <image :data-uid="item.uid" :src="item.photo_s" mode="aspectFill" @tap="bind_dl"></image>
              </view>

              <view class="dd">
                <view :class="'span ico ' + item.gzclass" :data-idx="trend_idx" :data-idx2="trend_idx2"
                      :data-uid="item.uid"
                      @tap="gzFn">
                  {{ item.gzclass == 'ed' ? '' : '' }} 喜欢
                </view>
                <view :data-uid="item.uid" class="h2" @tap="bind_dl">
                  <text class="font">{{ item.nickname }}</text>
                  <image :src="item.grade_ico" class="ugrade1"></image>
                </view>
                <view class="h3">{{ item.data_str }}</view>
                <view class="h1">{{ item.C.C }}</view>
                <view v-if="item.C.kind == 'pic'" class="h1">
                  <image :src="item.C.path_b" class="alpha0_100_1s" mode="widthFix"></image>
                </view>
                <view v-if="item.pic_arr.length > 0" :class="item.pic_arr.length <= 1 ? 'h1' : 'p'">
                  <image
                      v-for="(item3, index) in item.pic_arr"
                      :key="index"
                      :data-cur="item3"
                      :data-idx="trend_idx"
                      :data-idx2="trend_idx2"
                      :src="item3"
                      class="alpha0_100_1s"
                      mode="widthFix"
                      @tap="zoom9Fn"
                  ></image>
                </view>
              </view>

              <view class="agree">
                <text class="time">{{ item.addtime }}</text>
                <view :class="'i ' + item.agree_class" :data-id="item.id" :data-idx="trend_idx" :data-idx2="trend_idx2"
                      @tap="agreeFn">
                  <text class="font ico S16"></text>
                  <text class="font">
                    <text :style="'display:' + item.agreefly + ';'" class="b agreefly">+1</text>
                    <text class="span">{{ item.agree_arr.length > 0 ? item.agree_arr.length : '' }}</text>
                    　
                  </text>
                </view>
                <view :class="'i ' + item.bbs_class" :data-id="item.id" :data-idx="trend_idx" :data-idx2="trend_idx2"
                      @tap="bbsFn">
                  <text class="font ico S16"></text>
                  <text class="font">
                    <text class="span">{{ item.bbs_arr.length > 0 ? item.bbs_arr.length : '' }}</text>
                  </text>
                </view>
              </view>

              <view class="j"></view>

              <view v-if="item.agree_arr.length > 0" class="em">
                <image v-for="(item2, index) in item.agree_arr" :key="index" :data-uid="item2.uid" :src="item2.photo_s"
                       mode="aspectFill" @tap="bind_dl"></image>
              </view>

              <view v-if="item.bbs_arr.length > 0" class="ul">
                <view v-for="(item3, index) in item.bbs_arr" :key="index" class="li">
                  <image :data-uid="item3.uid" :src="item3.photo_s" class="m" mode="aspectFill" @tap="bind_dl"></image>

                  <view class="h5">
                    {{ item3.nickname }}：
                    <text class="font">{{ item3.addtime }}</text>
                  </view>

                  <view class="span">
                    <text :class="'font' + (item3.c == '审核中' ? ' C999' : '')">{{ item3.c }}</text>
                  </view>
                </view>
              </view>
            </view>
          </block>
          <view v-if="ARR_trend_nodata" class="nodata">
            <image mode="aspectFit" src="/static/res/img/nodata.png"></image>
            暂时还没有人发动态　
            <text :style="'color:' + color" data-t="new" @tap="trend_tab2Fn">返回首页</text>
          </view>
          <view v-if="loading_flag" class="loading">
            <image v-if="loading_ico_flag" class="loading_ico" src="/static/res/img/loading_ico.svg"></image>
            <text>{{ loading_str }}</text>
          </view>
        </scroll-view>
        <page-container
            :closeOnSlideDown="false"
            :overlay="true"
            :round="true"
            :show="bbsFormFlag"
            customStyle="height:35%"
            duration="300"
            position="top"
            zIndex="222"
            @clickoverlay="bbsFormMaskFn"
        >
          <form :data-id="bbs_form_id" :data-idx="bbs_form_idx" :data-idx2="bbs_form_idx2" @submit="bbs_submitFn">
            <view class="bbs_form_box">
              <view class="S16 B">{{ Farr.title }}</view>
              <textarea :focus="bbs_content_focus" :value="bbs_content" name="bbs_content"
                        placeholder="请文明发言~"></textarea>
            </view>
            <button :style="'width:80%;--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5" formType="submit"
                    type="button">提交评论
            </button>
          </form>
        </page-container>
        <view v-if="backtop_flag_index" :style="'color:' + color" class="backtop fadeInUp" data-id="trend"
              @tap="backtopFn">
          <text class="ico icon-backtop"></text>
          顶部
        </view>
        <view v-if="div_right_flag" :class="'mask1 div_right_mask ' + div_right_mask_class"
              @tap.stop.prevent="div_right_close_Fn">
          <view :class="'div_right_box ' + div_right_box_class" @tap.stop.prevent="div_right_boxFn">
            <view class="div_left_so">
              <form class="form_uid" @submit="trend_form_uid_submitFn">
                <input
                    :value="keyword"
                    autocomplete="off"
                    class="input"
                    confirmType="search"
                    maxlength="20"
                    name="keyword"
                    placeholder="按用户ID/昵称"
                    type="text"
                    @confirm="trend_input_uid_submitFn"
                />
                <button class="ico" formType="submit" style="z-index: 9"></button>
              </form>
              <form
                  :style="'--color:' + color + ';--rgbcolor:' + rgbcolor"
                  class="form_ext"
                  @submit="trend_form_ext_submitFn"
                  @reset.stop.prevent="trend_form_ext_resetFn"
              >
                <view v-for="(item, idx) in trendSO" :key="idx" class="tbox">
                  <view class="h5 on">{{ item.tbody }}</view>

                  <view class="ul def col3">
                    <view
                        v-for="(item2, idx2) in item.arr"
                        :key="idx2"
                        :class="'li' + (globalUtils.indexOf(item.v, item2.i) ? ' ed' : '')"
                        :data-fkind="item.fkind"
                        :data-idx="idx"
                        :data-v="item2.i"
                        @tap="trend_form_ext_liFn"
                    >
                      {{ item2.v }}
                    </view>
                  </view>

                  <input :name="item.f" :value="item.v" hidden type="text"/>
                </view>
                <view class="savebox">
                  <button class="reset" formType="reset">重置</button>
                  <button class="ico" formType="submit"> 确定</button>
                </view>
                <view class="blank"></view>
              </form>
            </view>
          </view>
        </view>
      </swiper-item>
    </swiper>
    <!-- parse <include src="../login.wxml"></include> -->
    <block>
      <view v-if="div_login" class="mask3 alpha0_100">
        <view
            class="div_box big_normal"
            style="--div_box_width: 82%; --div_box_height: 666rpx; background: -webkit-linear-gradient(top, #fde9ee 1%, #fff 150%); background-color: #fff"
        >
          <view :style="'border-color:rgba(' + rgbcolor + ',.2);'" class="m">
            <image mode="aspectFit" src="/static/res/img/photo_m.png"></image>
          </view>
          <view class="S22 B">登录后获得更精准推荐</view>
          <view class="loginagree">
            <checkbox-group @change="ifagreeFn">
              <label style="margin-left: -10rpx">
                <checkbox :style="'--color:' + color + ';'" value="1"></checkbox>
                <text class="C666 vmiddle">阅读并同意</text>
              </label>
            </checkbox-group>
            <navigator :style="'color:' + color" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=agreement">用户协议
            </navigator>
            <text class="C666 vmiddle">与</text>
            <navigator :style="'color:' + color + ';'" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=declara">隐私条款
            </navigator>
          </view>
          <button
              v-if="ifagree"
              :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
              class="btn5 W90_"
              openType="getPhoneNumber"
              @getphonenumber="getPhoneNumber"
          >
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
                  class="btn5" @tap="ifagree_passFn">
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <view class="C666" @tap="back">
            <text style="border-bottom: #999 1px solid">暂不登录</text>
          </view>
        </view>
      </view>
    </block>
  </view>
</template>
<script>
import globalUtils from "../../res/www.a9a.cn";

var t;
var a;
var e = require('../../@babel/runtime/helpers/defineProperty');
var i = require('../../res/www.a9a.cn.js');
var n = 2;
var r = 2;
var s = true;
var app = getApp();
var o = uni.getStorageSync('COOK_U');
export default {
  computed: {
    globalUtils() {
      return globalUtils
    }
  },
  data() {
    return {
      color: app.globalData._ZEAI.color,
      rgbcolor: app.globalData._ZEAI.rgbcolor,
      topbar: ['推荐', '动态'],
      currentTab: 0,
      ARR_index_nodata: false,
      ARR_trend_nodata: false,
      triggered: true,
      loading_flag: false,
      loading_ico_flag: false,
      loading_str: '拼命加载中',
      backtop_flag_index: false,
      triggered2: true,
      marquee_flag: true,
      ARR_trend: [],
      trendSO: '',
      bbsFormFlag: false,
      bbs_content: '',
      bbs_form_id: '',
      bbs_form_idx: '',
      bbs_form_idx2: '',
      bbs_content_focus: false,
      div_right_mask_class: '',
      div_right_box_class: '',
      div_right_flag: false,
      keyword: '',
      marquee: '',
      SHARE: '',
      ARR_index: '',

      pxSO: {
        age: {
          arr: '',
          def: ''
        },

        heigh: {
          arr: '',
          def: ''
        }
      },

      SO: '',
      areaidARR: '',
      area2idARR: '',
      pxclass: '',
      sobox: '',
      sokind: '',
      somoreclass: '',
      div_login: false,
      scrolltopNum_index: 0,

      rs: {
        uid: '',
        rz_store: '',
        photo_m: '',
        grade: 0,
        rzj: '',
        nickname: '',
        grade_ico: '',
        datainfo: '',
        hobby: [],
        photolist: [],
        photolist_cls: '',
        aboutus: ''
      },

      dl: [],
      rs2: [],
      pl: '',
      idx2: 0,
      scrolltopNum_trend: 0,
      trend_idx: 0,
      dl2: [],
      trend_idx2: 0,

      Farr: {
        title: ''
      },

      ifagree: ''
    };
  },
  onLoad: function (t) {
    uni.switchTab({
      url: 'index4'
    });
  },
  onShareAppMessage: function (t) {
    return {
      imageUrl: this.SHARE.imgurl,
      title: this.SHARE.title,
      path: '/pages/index/index'
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.SHARE.imgurl,
      title: this.SHARE.title,
      query: '',
      path: '/pages/index/index'
    };
  },
  methods: {
    marqueeFn: function () {
      this.setData({
        marquee_flag: false
      });
    },

    topbarFn: function (t) {
      this.setData({
        currentTab: t.currentTarget.dataset.idx
      });
    },

    swiperChange: function (t) {
      this.setData({
        currentTab: t.detail.current
      });
    },

    setloading: function (t, a) {
      if ('start' == t) {
        this.setData({
          loading_flag: true,
          loading_ico_flag: true,
          loading_str: a
        });
      } else {
        this.setData({
          loading_flag: false,
          loading_ico_flag: false,
          loading_str: a
        });
      }
    },

    trend_tab2Fn: function (t) {
      var e = t.currentTarget.dataset.t;
      a = {
        t: e
      };
      this.trend_init();
    },

    trend_init: function () {
      var that = this;
      uni.showLoading({
        title: '拼命加载中...',
        mask: true
      });
      s = false;
      var n = {
        submitok: 'trend',
        openid: (o = uni.getStorageSync('COOK_U')).openid
      };
      i.empty(a) || (n = JSON.parse((JSON.stringify(n) + JSON.stringify(a)).replace(/}{/, ',')));
      app.globalData.ajax({
        url: 'trend.php',
        data: n,
        success: function (a) {
          var i;
          if (1 == a.flag) {
            0 == a.LIST.length
                ? that.setData({
                  ARR_trend: [],
                  trendSO: a.SO,
                  ARR_trend_nodata: true
                })
                : that.setData((e((i = {}), 'ARR_trend[0]', a.LIST), e(i, 'trendSO', a.SO), i));
          } else {
            uni.showToast({
              title: a.msg,
              icon: 'none',
              mask: true
            });
          }
          s = true;
          uni.hideLoading();
        }
      });
    },

    trend_topFn: function (t) {
      var that = this;
      uni.vibrateShort({
        type: 'heavy'
      });
      setTimeout(function () {
        that.setData({
          triggered2: false,
          ARR_trend: []
        });
        that.setloading('end', '拼命加载中');
        r = 2;
        that.trend_init();
      }, 500);
    },

    trend_btmFn: function (t) {
      var n = this.ARR_trend;
      var that = this;
      if (s) {
        s = false;
        that.setloading('start', '拼命加载中');
        var u = {
          submitok: 'trend',
          p2: r,
          openid: o.openid
        };
        i.empty(a) || (u = JSON.parse((JSON.stringify(u) + JSON.stringify(a)).replace(/}{/, ',')));
        app.globalData.ajax({
          url: 'trend.php',
          data: u,
          success: function (t) {
            if (1 == t.flag) {
              var a = n.length;
              if (t.LIST.length < 1) {
                that.setloading('end', '已全部加载完毕');
                return void (s = false);
              }
              that.setData(e({}, 'ARR_trend[' + a + ']', t.LIST));
              r += 1;
            } else {
              uni.showToast({
                title: t.msg,
                icon: 'none',
                mask: true
              });
            }
            that.setloading('end', '上拉加载更多');
            s = true;
          }
        });
      }
    },

    gzFn: function (t) {
      var that = this;
      var n = t.currentTarget.dataset.idx;
      var r = t.currentTarget.dataset.idx2;
      var s = t.currentTarget.dataset.uid;
      app.globalData.chklogin().then(function (t) {
        t
            ? ((o = uni.getStorageSync('COOK_U')),
                app.globalData.ajax({
                  url: 'u.php',
                  data: {
                    submitok: 'ajax_gz',
                    uid: s,
                    openid: o.openid
                  },
                  success: function (t) {
                    1 == t.flag
                        ? (that.setData(e({}, 'ARR_trend[' + n + '][' + r + '].gzclass', t.gzclass)),
                            uni.showToast({
                              title: t.msg,
                              icon: 'none',
                              mask: true
                            }))
                        : ((t.this = that), (t.url = 'no'), i.sorry(t));
                  }
                }))
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    agreeFn: function (t) {
      var that = this;
      var n = t.currentTarget.dataset.idx;
      var r = t.currentTarget.dataset.idx2;
      var s = t.currentTarget.dataset.id;
      app.globalData.chklogin().then(function (t) {
        t
            ? ((o = uni.getStorageSync('COOK_U')),
                app.globalData.ajax({
                  url: 'trend.php',
                  data: {
                    submitok: 'ajax_agree',
                    tid: s,
                    openid: o.openid
                  },
                  success: function (t) {
                    if (1 == t.flag) {
                      var s;
                      var d = that.ARR_trend[n][r].agree_arr.length;
                      that.setData(
                          (e((s = {}), 'ARR_trend[' + n + '][' + r + '].agreefly', 'block'),
                              e(s, 'ARR_trend[' + n + '][' + r + '].agree_arr[' + d + ']', {
                                uid: t.uid,
                                photo_s: t.photo_s
                              }),
                              s)
                      );
                    } else {
                      t.this = that;
                      t.url = 'no';
                      i.sorry(t);
                    }
                  }
                }))
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    bbsFn: function (t) {
      var that = this;
      var e = t.currentTarget.dataset.idx;
      var i = t.currentTarget.dataset.idx2;
      var n = t.currentTarget.dataset.id;
      this.setData({
        bbsFormFlag: true,
        bbs_content: '',
        bbs_form_id: n,
        bbs_form_idx: e,
        bbs_form_idx2: i
      });
      setTimeout(function () {
        that.setData({
          bbs_content_focus: true
        });
      }, 500);
    },

    bbsFormMaskFn: function () {
      this.setData({
        bbsFormFlag: false,
        bbs_content_focus: false
      });
    },

    bbs_submitFn: function (t) {
      var that = this;
      app.globalData.chklogin().then(function (n) {
        n
            ? uni.showModal({
              title: '温馨提醒',
              content: '确定提交么？\n以下情形话题将被删除或封号：\n1．请勿留下任何形式联系方法\n2．请勿发表涉黄涉政相关言论\n3．请勿发表辱骂攻击他人言论',
              confirmColor: that.color,
              cancelText: '取消',
              confirmText: '确定',
              success: function (n) {
                if (n.confirm) {
                  var r = t.currentTarget.dataset.idx;
                  var s = t.currentTarget.dataset.idx2;
                  var c = t.currentTarget.dataset.id;
                  var u = t.detail.value.bbs_content;
                  o = uni.getStorageSync('COOK_U');
                  app.globalData.ajax({
                    url: 'trend.php',
                    data: {
                      submitok: 'bbs_add',
                      fid: c,
                      content: u,
                      openid: o.openid
                    },
                    success: function (t) {
                      if (1 == t.flag) {
                        var n;
                        var d = that.ARR_trend[r][s].bbs_arr.length;
                        that.setData(
                            (e((n = {}), 'ARR_trend[' + r + '][' + s + '].bbs_class', t.ARR.bbs_class),
                                e(n, 'ARR_trend[' + r + '][' + s + '].bbs_arr[' + d + ']', t.ARR.bbs_arr),
                                e(n, 'bbsFormFlag', false),
                                e(n, 'bbs_content_focus', false),
                                n)
                        );
                      } else {
                        t.this = that;
                        t.url = 'no';
                        i.sorry(t);
                      }
                    }
                  });
                }
              }
            })
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    zoom9Fn: function (t) {
      var a = t.currentTarget.dataset.cur;
      var e = t.currentTarget.dataset.idx;
      var n = t.currentTarget.dataset.idx2;
      i.empty(a) ||
      uni.previewImage({
        current: a,
        urls: this.ARR_trend[e][n].pic_arr
      });
    },

    trend_addFn: function () {
      app.globalData.chklogin().then(function (t) {
        t
            ? uni.navigateTo({
              url: '/pages/trend/trend?t=add'
            })
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    trend_soFn: function () {
      this.setData({
        div_right_mask_class: 'alpha0_100',
        div_right_box_class: 'div_leftAnm1',
        div_right_flag: true
      });
    },

    div_right_close_Fn: function () {
      var that = this;
      this.setData({
        div_right_mask_class: 'alpha100_0',
        div_right_box_class: 'div_leftAnm2'
      });
      setTimeout(function () {
        that.setData({
          div_right_flag: false
        });
      }, 500);
    },

    div_right_boxFn: function () {
    },

    trend_form_uid_submitFn: function (t) {
      var e = t.detail.value.keyword;
      a = {
        keyword: e
      };
      this.div_right_close_Fn();
      this.trend_init();
    },

    trend_input_uid_submitFn: function (t) {
      var e = t.detail.value;
      a = {
        keyword: e
      };
      this.div_right_close_Fn();
      this.trend_init();
    },

    trend_form_ext_liFn: function (t) {
      var a;
      var n = t.currentTarget.dataset.idx;
      var r = t.currentTarget.dataset.v;
      var s = t.currentTarget.dataset.fkind;
      var d = this.trendSO[n].v;
      a = i.empty(d) ? r : 'checkbox' == s ? (i.indexOf(d, r) ? (a = i.json_remove(d, r)).join(',') : d + ',' + r) : r;
      if (0 == r) {
        a = 0;
      }
      this.setData(e({}, 'trendSO[' + n + '].v', a));
    },

    trend_form_ext_submitFn: function (t) {
      a = t.detail.value;
      this.div_right_close_Fn();
      this.trend_init();
    },

    trend_form_ext_resetFn: function (t) {
      var a = this.trendSO;
      for (var i in a) {
        this.setData(e({}, 'trendSO[' + i + '].v', 0));
      }
      this.setData({
        keyword: ''
      });
    },

    init: function () {
      var that = this;
      uni.showLoading({
        title: '拼命加载中...',
        mask: true
      });
      s = false;
      var n = {
        submitok: 'index',
        openid: (o = uni.getStorageSync('COOK_U')).openid
      };
      i.empty(t) || (n = JSON.parse((JSON.stringify(n) + JSON.stringify(t)).replace(/}{/, ',')));
      app.globalData.ajax({
        url: 'index.php',
        data: n,
        success: function (t) {
          if (1 == t.flag) {
            var n;
            if (0 == t.LIST.length || i.empty(t.LIST)) {
              that.setData({
                marquee: t.marquee,
                SHARE: t.SHARE,
                ARR_index: t.LIST,
                ARR_index_nodata: true,
                pxSO: t.pxSO,
                SO: t.SO,
                areaidARR: t.areaidARR,
                area2idARR: t.area2idARR
              });
            } else {
              that.setData({
                marquee: t.marquee,
                SHARE: t.SHARE,
                'ARR_index[0]': t.LIST,
                ARR_index_nodata: false,
                pxSO: t.pxSO,
                SO: t.SO,
                areaidARR: t.areaidARR,
                area2idARR: t.area2idARR
              });
            }
            var r = i.get_tabbar_index('my_msg');
            t.btmnewnum > 0
                ? uni.setTabBarBadge({
                  index: r,
                  text: t.btmnewnum
                })
                : uni.removeTabBarBadge({
                  index: r
                });
          } else {
            uni.showToast({
              title: t.msg,
              icon: 'none',
              mask: true
            });
          }
          uni.hideLoading();
          s = true;
        }
      });
    },

    upFn: function (t) {
      var that = this;
      uni.vibrateShort({
        type: 'heavy'
      });
      setTimeout(function () {
        that.setData({
          triggered: false,
          loading_flag: false,
          loading_str: '拼命加载中',
          ARR_index: [],
          ARR_index_nodata: false
        });
        n = 2;
        that.init();
      }, 500);
    },

    btmFn: function (a) {
      var r = this.ARR_index;
      var that = this;
      if (s) {
        s = false;
        that.setloading('start', '拼命加载中');
        var u = {
          submitok: 'index',
          p: n,
          openid: o.openid
        };
        i.empty(t) || (u = JSON.parse((JSON.stringify(u) + JSON.stringify(t)).replace(/}{/, ',')));
        app.globalData.ajax({
          url: 'index.php',
          data: u,
          success: function (t) {
            if (1 == t.flag) {
              var a = r.length;
              if (t.LIST.length < 1) {
                that.setloading('end', '已全部加载完毕');
                return void (s = false);
              }
              that.setData(e({}, 'ARR_index[' + a + ']', t.LIST));
              n += 1;
              s = true;
            } else {
              uni.showToast({
                title: t.msg,
                icon: 'none',
                mask: true
              });
            }
            that.setloading('end', '上拉加载更多');
          }
        });
      }
    },

    backtopFn: function (t) {
      var a = 'scrolltopNum_' + t.currentTarget.dataset.id;
      this.setData(e({}, a, 0));
    },

    binnd_scroll_index: function (t) {
      t.detail.scrollTop > 100
          ? this.setData({
            backtop_flag_index: true
          })
          : this.setData({
            backtop_flag_index: false
          });
    },

    bind_dl: function (t) {
      var a = t.currentTarget.dataset.uid;
      uni.navigateTo({
        url: '/pagesA/u/u?uid=' + a
      });
    },

    pxFn: function () {
      var t;
      var a;
      'ed' == this.pxclass ? ((a = false), (t = '')) : ((t = 'ed'), (a = true));
      this.setData({
        pxclass: t,
        sobox: a
      });
    },

    souboxFn: function (a) {
      var e = a.currentTarget.dataset.sokind;
      t = {
        sokind: e
      };
      this.setData({
        sokind: e
      });
      this.init();
    },

    px_ageFn: function (a) {
      var n = a.detail.value;
      if (n[0] > n[1]) {
        uni.showToast({
          title: '必须左小右大哦',
          icon: 'none'
        });
        return false;
      }
      var r = this.pxSO.age.arr[0];
      var s = i.idx_iv(n, r);
      var d = s[0];
      var o = (s[1], d.split(','));
      this.setData(e({}, 'pxSO.age.def', o));
      t = {
        sokind: 'ext',
        age: d
      };
      this.init();
    },

    px_heighFn: function (a) {
      var n = a.detail.value;
      if (n[0] > n[1]) {
        uni.showToast({
          title: '必须左小右大哦',
          icon: 'none'
        });
        return false;
      }
      var r = this.pxSO.heigh.arr[0];
      var s = i.idx_iv(n, r);
      var d = s[0];
      var o = (s[1], d.split(','));
      this.setData(e({}, 'pxSO.heigh.def', o));
      t = {
        sokind: 'ext',
        heigh: d
      };
      this.init();
    },

    moreFn: function () {
      var t;
      t = 'ed' == this.somoreclass ? '' : 'ed';
      this.setData({
        index_so_flag: true,
        index_so_mask_class: 'alpha0_100',
        index_so_box_class: 'div_leftAnm1',
        somoreclass: t
      });
    },

    index_so_closeFn: function () {
      var that = this;
      this.setData({
        index_so_mask_class: 'alpha100_0',
        index_so_box_class: 'div_leftAnm2',
        somoreclass: ''
      });
      setTimeout(function () {
        that.setData({
          index_so_flag: false
        });
      }, 400);
    },

    rangFn: function (t) {
      t.currentTarget.dataset.f;
      var a;
      var n = t.currentTarget.dataset.index;
      var r = t.detail.value;
      if (r[0] > r[1]) {
        uni.showToast({
          title: '请选择左小右大范围',
          icon: 'none',
          mask: true
        });
      } else {
        var s = i.idx_iv(r, this.SO[n].arr.arr[0]);
        this.setData((e((a = {}), 'SO[' + n + '].i', s[0]), e(a, 'SO[' + n + '].v', s[1]), a));
      }
    },

    index_SO_onoffFn: function (t) {
      var a;
      var i = t.currentTarget.dataset.index;
      a = 'on' == this.SO[i].onoff ? 'off' : 'on';
      this.setData(e({}, 'SO[' + i + '].onoff', a));
    },

    index_SO_liFn: function (t) {
      if ('vip' != t.currentTarget.dataset.auth) {
        var a;
        var n = t.currentTarget.dataset.idx;
        var r = t.currentTarget.dataset.i;
        var s = t.currentTarget.dataset.fkind;
        var d = this.SO[n].i;
        a = i.empty(d) ? r : 'checkbox' == s ? (i.indexOf(d, r) ? (a = i.json_remove(d, r)).join(',') : d + ',' + r) : r;
        if (0 == r) {
          a = 0;
        }
        this.setData(e({}, 'SO[' + n + '].i', a));
      } else {
        this.vipFn();
      }
    },

    index_SO_submitFn: function (a) {
      (t = a.detail.value).keyword = this.keyword;
      this.index_so_closeFn();
      this.init();
    },

    index_SO_resetFn: function (t) {
      var a = this.SO;
      for (var i in a) {
        var n;
        this.setData((e((n = {}), 'SO[' + i + '].i', 0), e(n, 'SO[' + i + '].v', ''), n));
      }
      this.setData({
        keyword: ''
      });
    },

    vipFn: function () {
      app.globalData.chklogin().then(function (t) {
        t
            ? uni.navigateTo({
              url: '/pagesA/my_vip/my_vip'
            })
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    areaidFn: function (t) {
      for (var a, n = t.currentTarget.dataset.kind, r = (t.currentTarget.dataset.f, t.detail.value), s = t.currentTarget.dataset.idx, d = [], o = 0; o < r.length; o++) {
        if (r[o] > 0) {
          d.push(r[o] - 1);
        }
      }
      r = d;
      if ('hj' == n) {
        var c = i.areaGetTtitle(r, this.area2idARR);
      } else {
        c = i.areaGetTtitle(r, this.areaidARR);
      }
      var u = c[0];
      var l = c[1];
      this.setData((e((a = {}), 'SO[' + s + '].i', u), e(a, 'SO[' + s + '].v', l), a));
    },

    areaidChangeFn: function (t) {
      var a;
      var n = t.currentTarget.dataset.kind;
      var r = t.detail.column;
      var s = t.detail.value;
      var d = t.currentTarget.dataset.idx;
      var o = 'hj' == n ? 4 : parseInt(this.SO[d].arealeval);
      var c = {
        def: this.SO[d].arr.def,
        idx: this.SO[d].arr.idx
      };
      if ('hj' == n) {
        var u = this.area2idARR.ARR1;
        var l = this.area2idARR.ARR2;
        var _ = this.area2idARR.ARR3;
        var g = this.area2idARR.ARR4;
      } else {
        u = this.areaidARR.ARR1;
        l = this.areaidARR.ARR2;
        _ = this.areaidARR.ARR3;
        g = this.areaidARR.ARR4;
      }
      var h;
      var f;
      var x;
      var v = [
        {
          i: '0',
          v: '不限',
          f: '0'
        }
      ];
      var p = u;
      var R = [];
      var b = [];
      var m = [];
      switch (((p = v.concat(p)), r)) {
        case 0:
          if (0 == s) {
            switch (((c.def[0] = p), o >= 2 && (c.def[1] = v), o >= 3 && (c.def[2] = v), o >= 4 && (c.def[3] = v), o)) {
              case 1:
                c.idx = [0];
                break;
              case 2:
                c.idx = [0, 0];
                break;
              case 3:
                c.idx = [0, 0, 0];
                break;
              case 4:
                c.idx = [0, 0, 0, 0];
            }
          } else {
            switch (((h = u[s - 1].i), o)) {
              case 1:
                c.def = [p];
                c.idx = [s];
                break;
              case 2:
                R = v.concat(i.areaNEW(h, l));
                c.def = [p, R];
                c.idx = [s, 0];
                break;
              case 3:
                R = v.concat(i.areaNEW(h, l));
                c.def = [p, R, v];
                c.idx = [s, 0, 0];
                break;
              case 4:
                R = v.concat(i.areaNEW(h, l));
                c.def = [p, R, v, v];
                c.idx = [s, 0, 0, 0];
            }
          }
          break;
        case 1:
          if (0 == s) {
            if (o >= 3) {
              c.def[2] = v;
            }
            if (o >= 4) {
              c.def[3] = v;
            }
            if (o >= 2) {
              c.idx[1] = s;
            }
            if (o >= 3) {
              c.idx[2] = 0;
            }
            if (o >= 4) {
              c.idx[3] = 0;
            }
          } else {
            switch (o) {
              case 2:
                c.idx[1] = s;
                break;
              case 3:
                h = u[c.idx[0] - 1].i;
                f = (R = v.concat(i.areaNEW(h, l)))[s].i;
                b = v.concat(i.areaNEW(f, _));
                c.def[2] = b;
                c.idx[1] = s;
                c.idx[2] = 0;
                break;
              case 4:
                h = u[c.idx[0] - 1].i;
                f = (R = v.concat(i.areaNEW(h, l)))[s].i;
                b = v.concat(i.areaNEW(f, _));
                c.def[2] = b;
                c.def[3] = v;
                c.idx[1] = s;
                c.idx[2] = 0;
                c.idx[3] = 0;
            }
          }
          break;
        case 2:
          if (0 == s) {
            if (o >= 4) {
              c.def[3] = v;
            }
            if (o >= 3) {
              c.idx[2] = s;
            }
            if (o >= 4) {
              c.idx[3] = 0;
            }
          } else {
            switch (o) {
              case 3:
                c.idx[2] = s;
                break;
              case 4:
                h = u[c.idx[0] - 1].i;
                f = (R = v.concat(i.areaNEW(h, l)))[c.idx[1]].i;
                x = (b = v.concat(i.areaNEW(f, _)))[s].i;
                m = v.concat(i.areaNEW(x, g));
                c.def[3] = m;
                c.idx[2] = s;
                c.idx[3] = 0;
            }
          }
          break;
        case 3:
          if (o >= 4) {
            c.idx[3] = s;
          }
      }
      this.setData((e((a = {}), 'SO[' + d + '].arr.def', c.def), e(a, 'SO[' + d + '].arr.idx', c.idx), a));
    },

    index_SO_uid_submitFn: function (a) {
      t = a.detail.value;
      this.setData({
        keyword: t.keyword
      });
      this.index_so_closeFn();
      this.init();
    },

    index_SO_uid_submitFn2: function (a) {
      var e = a.detail.value;
      this.index_so_closeFn();
      t = {
        sokind: 'keyword',
        keyword: e
      };
      this.init();
    },

    index_SO_uid_bindblurFn: function (t) {
      var a = t.detail.value;
      this.setData({
        keyword: a
      });
    },

    getPhoneNumber: function (t) {
      uni.login({
        success: function (a) {
          uni.request({
            url: app.globalData.WWW + '/api/wxxcx/get_openid.php',
            data: {
              code: a.code
            },
            success: function (a) {
              a = i.jsoneval(a.data);
              o = uni.getStorageSync('COOK_U');
              uni.request({
                url: app.globalData.WWW + '/api/wxxcx/get_mob.php',
                data: {
                  session_key: encodeURIComponent(a.U.session_key),
                  encryptedData: encodeURIComponent(t.detail.encryptedData),
                  iv: encodeURIComponent(t.detail.iv),
                  openid: a.U.openid
                },
                success: function (t) {
                  t = i.jsoneval(t.data);
                  uni.reLaunch({
                    url: '../my/my'
                  });
                },
                fail: function (t) {
                  uni.showModal({
                    content: t,
                    showCancel: false
                  });
                }
              });
            }
          });
        }
      });
    },

    back: function () {
      this.setData({
        div_login: false
      });
      uni.navigateBack();
    },

    lawFn: function (t) {
      var a = t.currentTarget.dataset.kind;
      uni.navigateTo({
        url: '/pagesA/about/law?kind=' + a
      });
    },

    emptyFn: function () {
    },

    ifagreeFn() {
      console.log('占位：函数 ifagreeFn 未声明');
    },

    ifagree_passFn() {
      console.log('占位：函数 ifagree_passFn 未声明');
    }
  }
};
</script>
<style>
@import './index.css';
</style>
